//
//  YHYAnimationDemo.m
//  LANGirl
//
//  Created by 杨泓晔 on 16/3/18.
//  Copyright © 2016年 杨泓晔. All rights reserved.
//

#import "YHYAnimationDemo.h"
#import "WSRequirementView.h"
#import "AppDelegate.h"
#import "YHYExpertFindViewCell.h"

@interface YHYAnimationDemo ()<UIScrollViewDelegate,WSRequirementViewDelegate>
@property(nonatomic,retain)UIView *aView;
@property(nonatomic,retain)UIView *bView;
@property(nonatomic,assign)BOOL isOk;
@property(nonatomic,retain)UITableView *mytableView;
@property(nonatomic,retain)UIView *cView;
@property(nonatomic,retain)UIImageView *LouDouImageView;
@property(nonatomic,retain)NSMutableArray *myArray;
@property(nonatomic,retain)NSMutableArray *myArray2;



@property (nonatomic,retain)UIImageView *sanjiImageV1;
@property (nonatomic,retain)UIImageView *sanjiImageV2;
@property (nonatomic,retain)UIImageView *sanjiImageV3;
@property (nonatomic,retain)UIView *bigView1;
@property (nonatomic,retain)UIView *bigView2;
@property (nonatomic,retain)UIView *bigView3;
@property (nonatomic,assign)BOOL isSelect;
@property (nonatomic,retain)UILabel *nameL1;
@property (nonatomic,retain)UILabel *nameL2;
@property (nonatomic,retain)UILabel *nameL3;
@property (nonatomic,assign)BOOL isSelect2;
@property (nonatomic,assign)BOOL isSelect3;


@end

@implementation YHYAnimationDemo
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
        self.isSelect = YES;
        self.isSelect2 = YES;
        self.isSelect3 = YES;
        
        
    }
    return self;
}

- (void)appTap:(UITapGestureRecognizer *)tap{
    
}

- (void)creatView{
    
    
    self.BigScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
    self.BigScrollView.contentSize=CGSizeMake(self.frame.size.width*3, 0);
    
    [self addSubview:self.BigScrollView];
    
    
    self.aView = [[UIView alloc]init];
    self.aView.frame = CGRectMake(0, 0, self.frame.size.width - 114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
    
    self.aView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.aView];
    
    
    
    self.bView = [[UIView alloc]init];
    self.bView.frame = CGRectMake(0,0, self.frame.size.width, 40.00*AUTO_WIDTH);
    self.bView.backgroundColor = [UIColor whiteColor];
    self.bView.alpha  = 0;
    [self addSubview:self.bView];
    
    
    self.cView = [[UIView alloc]init];
    self.cView.backgroundColor = DHT;
    self.cView.backgroundColor = [UIColor blackColor];
    self.cView.frame = CGRectMake(self.frame.size.width - 114.00*AUTO_WIDTH/2, 0, self.frame.size.width +114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
    [self addSubview:self.cView];
    
    
    UILabel *line = [[UILabel alloc]init];
    line.backgroundColor = HS;
    line.alpha = 0.0;
    [self.cView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.cView).offset(0);
        // make.left.equalTo(self.cView.left).offset(1);
        make.left.equalTo(self.cView.mas_left).offset(1);
        make.bottom.equalTo(self.cView).offset(0);
        make.size.mas_equalTo(CGSizeMake(1 * AUTO_WIDTH, 40.00*AUTO_WIDTH));
        
    }];
    
    UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(6 *AUTO_WIDTH, 5.00*AUTO_WIDTH, 2.00*AUTO_WIDTH, 30.00*AUTO_WIDTH)];
    [self.cView addSubview:imageView1];
    
    
    UIGraphicsBeginImageContext(imageView1.frame.size);   //开始画线
    [imageView1.image drawInRect:CGRectMake(0, 0, 2* AUTO_WIDTH, 30.00*AUTO_WIDTH)];
    imageView1.alpha = 0.5;
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);  //设置线条终点形状
    
    
    CGFloat lengths[] = {2,1};
    CGContextRef Hline = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(Hline, [UIColor blackColor].CGColor);
    
    CGContextSetLineDash(Hline, 0, lengths, 2);  //画虚线
    CGContextMoveToPoint(Hline, 0.0, 5.0);    //开始画线
    CGContextAddLineToPoint(Hline, 0.0, 30.00*AUTO_WIDTH);
    CGContextStrokePath(Hline);
    imageView1.image = UIGraphicsGetImageFromCurrentImageContext();
    
    
    UITapGestureRecognizer *donghua = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(donghuaAction:)];
    self.cView.userInteractionEnabled = YES;
    [self.cView addGestureRecognizer:donghua];
    self.LouDouImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"find_select"]];
    _LouDouImageView.backgroundColor = DHT;
    [self.cView addSubview:_LouDouImageView];
    [_LouDouImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.cView).offset(20.00*AUTO_WIDTH/2);
        make.left.equalTo(self.cView).offset(37.00*AUTO_WIDTH/2);
        make.size.mas_equalTo(CGSizeMake(20.00*AUTO_WIDTH, 20.00*AUTO_WIDTH));
    }];
    
    self.aView.backgroundColor = DHT;
    self.bView.backgroundColor = DHT;
    self.cView.backgroundColor = DHT;
    self.myArray = [NSMutableArray arrayWithObjects:@"推荐",@"最新",@"最热",nil];
    self.myArray2 = [NSMutableArray arrayWithObjects:@"报酬",@"身高",@"性别",nil];
    
    
    self.buttonArray =[NSMutableArray array];
    for (int  i = 0; i < self.myArray.count; i ++) {
        UIButton *bbbbbbb = [UIButton buttonWithType:UIButtonTypeCustom];
        bbbbbbb.tag = 1000 + i;
        
        bbbbbbb.frame = CGRectMake((self.frame.size.width-114.00*AUTO_WIDTH/2)/3*i, 0.00*AUTO_WIDTH/2, (self.frame.size.width-114.00*AUTO_WIDTH/2)/3, 40.00*AUTO_WIDTH);
        [bbbbbbb setTitle:self.myArray[i] forState:UIControlStateNormal];
        [bbbbbbb.titleLabel setFont:[UIFont systemFontOfSize:13 * AUTO_WIDTH]];
        [bbbbbbb setTitleColor:HS forState:UIControlStateNormal];
        [bbbbbbb addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.aView addSubview:bbbbbbb];
        [self.buttonArray addObject:bbbbbbb];
        if (i == 0) {
            [bbbbbbb setTitleColor:GH forState:UIControlStateNormal];
            [ bbbbbbb.titleLabel setFont:  [UIFont fontWithName:@"Arial" size:15.00*AUTO_WIDTH]];
            [_LineView mas_updateConstraints:^(MASConstraintMaker *make) {
                
                make.left.mas_equalTo(bbbbbbb.frame.origin.x);
                
            }];
        }
    }
    
    
    
    _bigView1 = [UIView new];
    [_bView addSubview:_bigView1];
    _bigView1.frame = CGRectMake(0, 0, (self.frame.size.width-114.00*AUTO_WIDTH/2)/3, 40 * AUTO_WIDTH);
    _nameL1 = [UILabel new];
    [_bigView1 addSubview:_nameL1];
    _nameL1.text = @"报酬";
    [_nameL1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.centerXWithinMargins.mas_equalTo(_bigView1);
        make.centerYWithinMargins.mas_equalTo(_bigView1);
        
    }];
    _nameL1.textColor = HS;
    _nameL1.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
    _sanjiImageV1 = [UIImageView new];
    [_bigView1 addSubview:_sanjiImageV1];
    _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
    [_sanjiImageV1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(17 * AUTO_HEIGHT);
        make.left.mas_equalTo(_nameL1.mas_right).offset(6 * AUTO_WIDTH);
        make.width.mas_equalTo(12 * AUTO_WIDTH);
        make.height.mas_equalTo(7 * AUTO_HEIGHT);
        
    }];
    
    _bigView1.userInteractionEnabled = YES;
    _bigView1.tag = 1000;
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(TApAction:)];
    [_bigView1 addGestureRecognizer:tap1];
    
    
    
    _bigView2 = [UIView new];
    [_bView addSubview:_bigView2];
    //_bigView2.backgroundColor = [UIColor redColor];
    _bigView2.frame = CGRectMake((self.frame.size.width - 114.00 * AUTO_WIDTH / 2) / 3 * 1, 0, (self.frame.size.width-114.00*AUTO_WIDTH/2)/3, 40 * AUTO_WIDTH);
    _nameL2 = [UILabel new];
    [_bigView2 addSubview:_nameL2];
    _nameL2.text = @"身高";
    // _nameL2.frame = CGRectMake(30 * AUTO_WIDTH, 0, 50 * AUTO_WIDTH, 40 * AUTO_WIDTH);
    [_nameL2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.centerXWithinMargins.mas_equalTo(_bigView2);
        make.centerYWithinMargins.mas_equalTo(_bigView2);
        
    }];
    _nameL2.textColor = HS;
    _nameL2.adjustsFontSizeToFitWidth = YES;
    _nameL2.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
    _sanjiImageV2 = [UIImageView new];
    [_bigView2 addSubview:_sanjiImageV2];
    _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
    //_sanjiImageV2.frame = CGRectMake(70 * AUTO_WIDTH,17 * AUTO_WIDTH, 12 * AUTO_WIDTH, 7 * AUTO_WIDTH);
    [_sanjiImageV2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(17 * AUTO_HEIGHT);
        make.left.mas_equalTo(_nameL2.mas_right).offset(6 * AUTO_WIDTH);
        make.width.mas_equalTo(12 * AUTO_WIDTH);
        make.height.mas_equalTo(7 * AUTO_HEIGHT);
        
    }];
    _bigView2.userInteractionEnabled = YES;
    _bigView2.tag = 1002;
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(TapAction2:)];
    [_bigView2 addGestureRecognizer:tap2];
    
    
    _bigView3 = [UIView new];
    [_bView addSubview:_bigView3];
    _bigView3.frame = CGRectMake((self.frame.size.width - 114.00 * AUTO_WIDTH / 2) / 3 * 2, 0, (self.frame.size.width-114.00*AUTO_WIDTH/2)/3, 40 * AUTO_WIDTH);
    _nameL3  = [UILabel new];
    [_bigView3 addSubview:_nameL3];
    _nameL3.text = @"性别";
    [_nameL3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.centerXWithinMargins.mas_equalTo(_bigView3);
        make.centerYWithinMargins.mas_equalTo(_bigView3);
        
    }];
    
    _nameL3.textColor = HS;
    _nameL3.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
    _sanjiImageV3 = [UIImageView new];
    [_bigView3 addSubview:_sanjiImageV3];
    _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
    [_sanjiImageV3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(17 * AUTO_HEIGHT);
        make.left.mas_equalTo(_nameL3.mas_right).offset(6 * AUTO_WIDTH);
        make.width.mas_equalTo(12 * AUTO_WIDTH);
        make.height.mas_equalTo(7 * AUTO_HEIGHT);
        
    }];
    
    UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(TapAction3:)];
    [_bigView3 addGestureRecognizer:tap3];
    
    
    
     
    self.LineView = [[UIView alloc] init];
    [self.aView addSubview:_LineView];
    self.LineView.backgroundColor = GH;
    [self.LineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.bottom.mas_offset(@0);
        make.width.mas_equalTo((SCREEN_WIDTH - (114.00 * AUTO_WIDTH / 2)) / 3);
        make.height.mas_equalTo(@2);
    }];

}

//协议方法
- (void)getSelectData:(NSString *)dataStr{
    //被点击完
    if (self.isSelect == NO) {
        
        [self setName:self.nameL1 withStr:dataStr];
        
        if ([dataStr isEqual:@"默认"]|| ! dataStr) {
            
            _nameL1.text=@"报酬";
            _nameL1.textColor=HS;
            _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
            
        }else{
     
            _sanjiImageV1.image = [UIImage imageNamed:@"jiantt"];
//            _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];

        }
    }
    
    if (self.isSelect2 == NO) {
        [self setName:self.nameL2 withStr:dataStr];
        
        if ([dataStr isEqual:@"默认"] ||!dataStr) {
            
            _nameL2.text=@"身高";
            _nameL2.textColor=HS;
           // _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
            _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
            
        }else{
        
//            _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
            _sanjiImageV2.image = [UIImage imageNamed:@"jiantt"];
//            _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
            
        }
        
    }
    
    if (self.isSelect3 == NO) {
        [self setName:self.nameL3 withStr:dataStr];
    
        if ([dataStr isEqual:@""] || !dataStr) {
           
            _nameL3.text=@"性别";
            _nameL3.textColor=HS;
//            _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
            _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
            
        }else{
        
//            _sanjiImageV1.image = [UIImage imageNamed:@"huiX"];
//            _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
            _sanjiImageV3.image = [UIImage imageNamed:@"jiantt"];
        }
        
    
    }
    
}

- (void)setName:(UILabel *)label withStr:(NSString *)str {
    
    if (str != nil) {
        label.text = str;
    }
    
}


//负责传值
- (void)presentReire:(NSMutableArray *)array name:(NSString *)title{
   WSRequirementView *view= [WSRequirementView new];
    view.dataArr = array;
    view.delegate = self;
    view.titleLabel.text = title;
    
    [view  showView];
    
}

- (void)TApAction:(UITapGestureRecognizer *)tapA{
    NSLog(@"fdsddssdsd");
    
    _isSelect = !_isSelect;
     NSMutableArray *arr= [NSMutableArray arrayWithObjects:@"默认",@"1600",@"1650",@"170", nil];
    [self presentReire:arr name:@"价格"];
    _sanjiImageV1.image = [UIImage imageNamed:@"jiant"];
    _nameL1.textColor = GH;
    _nameL1.font = [UIFont fontWithName:@"Arial" size:15 * AUTO_WIDTH];
    
    if (_isSelect == NO) {
        
//        _nameL2.textColor = HS;
//        _nameL3.textColor = HS;
//        _nameL2.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _nameL3.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
//        _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
        
        _isSelect2  = !_isSelect;
        _isSelect3 = !_isSelect;
        
    }
    else{
        NSLog(@"11");
        
//        _nameL3.textColor = HS;
//        _nameL2.textColor = HS;
//        _nameL3.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _nameL2.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
//        _sanjiImageV2.image = [UIImage imageNamed:@"huiX"];
        
        _isSelect = NO;
        
    }
    
}

- (void)TapAction2:(UITapGestureRecognizer *)tap2{
    
    NSLog(@"2");
    NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"默认",@"160 - 165",@"165 - 170",@"170 - 175", nil];
    _sanjiImageV2.image = [UIImage imageNamed:@"jiant"];
    _nameL2.textColor = GH;
    _nameL2.font = [UIFont fontWithName:@"Arial" size:15 * TEXTWEIGHT];
    
    
    [self presentReire:arr name:@"身高"];
    _isSelect2 = !_isSelect2;
    if (!_isSelect2) {
        
//        _nameL1.textColor = GH;
//        _nameL3.textColor = HS;
//        _nameL1.font = [UIFont fontWithName:@"Arial" size:14 * TEXTWEIGHT];
//        _nameL3.font = [UIFont fontWithName:@"Arial" size:14 * TEXTWEIGHT];
//        _sanjiImageV1.image = [UIImage imageNamed:@"jiantt"];
//        _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
        
        _isSelect  = !_isSelect2;
        _isSelect3 = !_isSelect2;
        
        
    }
    else{
        NSLog(@"21");
        
//        _nameL3.textColor = HS;
//        _nameL1.textColor = GH;
//        _nameL3.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _nameL1.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _sanjiImageV3.image = [UIImage imageNamed:@"huiX"];
//        _sanjiImageV1.image = [UIImage imageNamed:@"jiantt"];
        _isSelect2 = NO;
        
    }
    
}

- (void)TapAction3:(UITapGestureRecognizer *)tap3{
    NSLog(@"3");
   NSMutableArray  *arr= [NSMutableArray arrayWithObjects:@"男",@"女", nil];
    [self presentReire:arr name:@"性别"];
    //1 h红色
    _sanjiImageV3.image = [UIImage imageNamed:@"jiant"];
    _nameL3.textColor = GH;
    _nameL3.font = [UIFont fontWithName:@"Arial" size:15 * AUTO_WIDTH];
    
    
    _isSelect3 = !_isSelect3;
    if (!_isSelect3) {
        
//        _nameL2.textColor = GH;
//        _nameL1.textColor = GH;
//        _nameL2.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _nameL1.font = [UIFont fontWithName:@"Arial" size:14* AUTO_WIDTH];
//        _sanjiImageV2.image = [UIImage imageNamed:@"jiantt"];
//        _sanjiImageV1.image = [UIImage imageNamed:@"jiantt"];
        
        
        
        _isSelect2  = !_isSelect3;
        _isSelect = !_isSelect3;
        
        
    }
    else{
        NSLog(@"31");
        
//        _nameL2.textColor = GH;
//        _nameL1.textColor = GH;
//        _nameL2.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _nameL1.font = [UIFont fontWithName:@"Arial" size:14 * AUTO_WIDTH];
//        _sanjiImageV2.image = [UIImage imageNamed:@"jiantt"];
//        _sanjiImageV1.image = [UIImage imageNamed:@"jiantt"];
        _isSelect3 = NO;
    }
    
}



-(void)donghuaAction:(UITapGestureRecognizer *)click{
    
    if (!self.isOk) {
        
        [UIView animateWithDuration:0.5 animations:^{
            
            
            self.cView.frame = CGRectMake(0, 0, self.frame.size.width , 40.00*AUTO_WIDTH);
            
            
            self.bView.frame = CGRectMake(0,0 , 0, 40.00*AUTO_WIDTH);
            self.bView.alpha = 0;
            
            self.aView.frame = CGRectMake(0, 0, self.frame.size.width - 114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
            
            self.aView.alpha = 1;
            
        } completion:^(BOOL finished) {
            self.aView.alpha = 0;
            
            [UIView animateWithDuration:0.5 animations:^{
                
                self.cView.frame = CGRectMake(self.frame.size.width - 114.00*AUTO_WIDTH/2, 0, self.frame.size.width , 40.00*AUTO_WIDTH);
                
                
                self.bView.frame = CGRectMake(0,0 , self.frame.size.width - 114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
                self.aView.frame = CGRectMake(0, 0, 0, 40.00*AUTO_WIDTH);
                
                self.bView.alpha = 1;
                
                
                
                self.LouDouImageView.image = [UIImage imageNamed:@"find_back1"];
            }];
            
        }];
        
    }
    
    else {
        
        [UIView animateWithDuration:0.5 animations:^{
            
            
            self.cView.frame = CGRectMake(0, 0, self.frame.size.width , 40.00*AUTO_WIDTH);
            
            self.aView.frame = CGRectMake(0, 0, 0, 40.00*AUTO_WIDTH);
            
            self.aView.alpha = 0 ;
            
            self.bView.frame = CGRectMake(0,0 , self.frame.size.width - 114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
            
            
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.5 animations:^{
                
                
                self.cView.frame = CGRectMake(self.frame.size.width - 114.00*AUTO_WIDTH/2, 0, self.frame.size.width , 40.00*AUTO_WIDTH);
                self.aView.alpha = 1;
                self.aView.frame = CGRectMake(0, 0, self.frame.size.width - 114.00*AUTO_WIDTH/2, 40.00*AUTO_WIDTH);
                self.bView.frame = CGRectMake(self.frame.size.width - 114.00*AUTO_WIDTH/2,0 , 0, 40.00*AUTO_WIDTH);
                
                self.bView.alpha = 0;
                
                self.LouDouImageView.image = [UIImage imageNamed:@"find_select"];
            }];
            
        }];
        
        
    }
    self.isOk =! self.isOk;
    
}

-(void)buttonAction:(UIButton *)button{
        [self.delegate button:self.buttonArray[button.tag - 1000]];

    for (int i = 0 ; i < self.myArray.count; i++) {
        UIButton *bbb = [self.buttonArray objectAtIndex:i];
        [bbb setTitle:[self.myArray objectAtIndex:i ] forState:UIControlStateNormal];
//         [bbb  addTarget:self action:@selector(bbAction:) forControlEvents:UIControlEventTouchUpInside];
        
        [bbb setTitleColor:HS forState:UIControlStateNormal];
        [bbb.titleLabel setFont:[UIFont systemFontOfSize:13.00*AUTO_WIDTH] ];
        
        
        
    }
    [button setTitleColor:GH forState:UIControlStateNormal];
    //    [self.HTbutton setBackgroundColor:[UIColor colorWithRed:0.984 green:0.935 blue:0.950 alpha:1.000]];
    
    
    
    [button.titleLabel setFont:[UIFont systemFontOfSize:15.00*AUTO_WIDTH]];
    
    [_LineView mas_updateConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(button.frame.origin.x);
        
    }];
    
    
    
    
    [UIView animateWithDuration:0.3 animations:^{
        
    
        [self.aView layoutIfNeeded];
    }];
    
  
    
    
  
    
}


-(void) bbAction:(UIButton *) btn
{NSLog(@"fffff=%ld",btn.tag);
    
    NSLog(@"222222222222222222");
//    [self.delegate button:self.buttonArray[btn.tag - 1000]];
}


@end
